package org.sky.model;

import javax.persistence.*;
import java.util.Date;

@Entity
public class Booking {

    private int id;
    /**
     * 系统编号
     */
    private String orderId;

    /**
     * 预约用户
     */
    private Person userId;

    /**
     * 订房客户姓名
     */
    private String name;

    /**
     * 系统生成预约订单时间
     */
    private Date createDate;

    /**
     * 预约K房使用开始时间
     */
    private Date beginTime;

    /**
     * 预约K房使用结束时间
     */
    private Date endTime;

    /**
     * 唱K人数
     */
    private int singerNun;

    /**
     * 联系地址
     */
    private String address;

    /**
     * 联系电话
     */
    private String tel;

    /**
     * 负责人
     */
    private String chargeMan;

    /**
     * 订单状态
     * 0:等待审核   2：取消预约   1:预约成功
     */
    private int state = 0;

    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(nullable = false, length = 16)
    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    @ManyToOne
    @JoinColumn(name = "userId", nullable = false)
    public Person getUserId() {
        return userId;
    }

    public void setUserId(Person userId) {
        this.userId = userId;
    }

    @Column(nullable = false)
    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    @Column(nullable = false)
    public Date getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(Date beginTime) {
        this.beginTime = beginTime;
    }

    @Column(nullable = false)
    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    @Column(length = 4, nullable = false)
    public int getSingerNun() {
        return singerNun;
    }

    public void setSingerNun(int singerNun) {
        this.singerNun = singerNun;
    }

    @Column(length = 25)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Column(length = 13, nullable = false)
    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    @Column(length = 8)
    public String getChargeMan() {
        return chargeMan;
    }

    public void setChargeMan(String chargeMan) {
        this.chargeMan = chargeMan;
    }

    @Column(length = 3, nullable = false, columnDefinition = "INT default 0")
    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    @Column(length = 10, nullable = false)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
